<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>科研类型列表</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-4">
    <h1>科研类型列表</h1>
    <a th:href="@{/research-types/add}" class="btn btn-primary mb-3">添加科研类型</a>
    
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>类型名称</th>
            <th>描述</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="type : ${researchTypes}">
            <td th:text="${type.typeId}"></td>
            <td th:text="${type.typeName}"></td>
            <td th:text="${type.description}"></td>
            <td>
                <a th:href="@{/research-types/edit/{id}(id=${type.typeId})}" class="btn btn-sm btn-info">编辑</a>
                <a th:href="@{/research-types/delete/{id}(id=${type.typeId})}" class="btn btn-sm btn-danger" 
                   onclick="return confirm('确定要删除这个科研类型吗？这可能会影响相关的科研项目。')">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>